package cc.bookcloud.tool.ocr.controller;

import cc.bookcloud.tool.ocr.common.JResult;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;

/**
 * @Desc: @todo
 * @Version: 2.0
 * @Author: John Goo
 * @Date: 2024/08/07 16:03
 **/
@RestController
@Slf4j
public class ExampleController {

    @ApiOperation(value = "邮箱验证界面")
    @GetMapping("/example/toEmail")
    public ModelAndView goCompile(HttpServletRequest request) {
        ModelAndView view = new ModelAndView("pages/example-mail");
        return view;
    }

    //
    /**
     * 邮箱发送
     *
     */
    @ApiOperation(value = "邮箱发送")
    @GetMapping("/example/mail/send")
    public JResult<String> userDemo(HttpServletRequest request) {

        JResult<String> jResult = JResult.build();

        String email = request.getParameter("email");
        log.info("收到参数："+email);
        jResult.ok("ok");
        return jResult;

    }



}
